// 定义语句块
// 定义语句块下面对应的代码块
// 定义块

const path = require('path');
const staticImg = path.join(__dirname, 'static');

 function ArduinoUnoBlocks (Blockly) {
  var color_sensor = '#28BFE6';
//mpu
Blockly.Blocks.smartModule_mpu = {
  init:function(){
    this.setColour(color_sensor);
    this.appendDummyInput("")
     .appendField(new Blockly.FieldImage(staticImg+"/19.6-Axis （Gyro+Accelerometer）.svg", 84, 42))
      .appendField(Blockly.Msg.SMART_MPU)
        .appendField(Blockly.Msg.SMART_READMPU)
        .appendField(new Blockly.FieldDropdown([
          [Blockly.Msg.SMART_XAXIS, "GetGravity(BT_X)"],
          [Blockly.Msg.SMART_YAXIS, "GetGravity(BT_Y)"],
          [Blockly.Msg.SMART_ZAXIS, "GetGravity(BT_Z)"],
          [Blockly.Msg.SMART_ROLL, "GetRoll()"],
          [Blockly.Msg.SMART_PITCH, "GetPitch()"],
         
        ]),"mpu2")
  this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
      this.setOutput(true, 'Number');
    this.setTooltip('');
  } 
};
    return Blockly;
 }

module.exports = ArduinoUnoBlocks ;
